import re
import json
def rm_color(t):
    return re.sub(r'&.','',t)

total = []
f = open('en_us.snbt','r')
for line in f:
    a = line.find('"')
    b = line.rfind('"')
    if a != -1 and b != -1:
        toappend = line[a+1:b]
        total.append(rm_color(toappend))



def chunk_list(lst:list,s):
    return [lst[i:i+s] for i in range(0, len(lst), s)]





o = open('output.json','w')
json.dump(chunk_list(total,20),o)
print(len(total))